import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import axios from 'axios'
import VueAxios from 'vue-axios'
import { Popup, Cell  } from 'vant';
import { Swipe, SwipeItem } from 'vant';
import { Search } from 'vant';
import { Col, Row } from 'vant';
import { Stepper } from 'vant';
import { GoodsAction, GoodsActionIcon, GoodsActionButton } from 'vant';
import { Tabbar, TabbarItem } from 'vant';
import { Sidebar, SidebarItem } from 'vant';
import { Empty } from 'vant';
import { Form } from 'vant';
import { Field } from 'vant';
import { Button } from 'vant';

import { Overlay } from 'vant';
import { Toast } from 'vant';
import { Badge } from 'vant';
import { Checkbox, CheckboxGroup } from 'vant';
import { SubmitBar } from 'vant';
import { AddressEdit } from 'vant';

Vue.use(AddressEdit);
Vue.use(SubmitBar);
Vue.use(Checkbox);
Vue.use(CheckboxGroup);
Vue.use(Badge);
Vue.use(Toast);
Vue.use(Overlay);



// 局部配置携带cookie

// withCredentials 表示跨域请求时是否需要使用凭证
axios.defaults.withCredentials = true;

// 配置请求基础路径
axios.defaults.baseURL = 'http://www.kangliuyong.com:10002';

// 全局配置请求时携带cookie
axios.defaults.withCredentials = true;

// 配置请求头
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8';
Vue.use(Popup);
Vue.use(Button);
Vue.use(Form);
Vue.use(Field);
Vue.use(Empty);
Vue.use(Sidebar);
Vue.use(SidebarItem);
Vue.use(Tabbar);
Vue.use(TabbarItem);
Vue.use(Search);
Vue.use(GoodsAction);
Vue.use(GoodsActionButton);
Vue.use(GoodsActionIcon);
Vue.use(Stepper);
Vue.use(Col);
Vue.use(Row);
Vue.use(Swipe);
Vue.use(SwipeItem);
Vue.use(Cell)
Vue.use(VueAxios, axios);
Vue.config.productionTip = false;

new Vue({
  router,
  store,
  el: '#app',
  render: h => h(App),
}).$mount('#app')
